//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <core.h>
#include <_hal.h>
#include <init.h>

EXTERN_C DECL_CODEINIT void CDECL SetupCPU()
{
    //
    // disable fpu CU[1] == 0 and set CU[0] == 0
    // cp0 is always enable in kernel mode
    //
#if defined(_GNUC)
    ASM("mfc0   $8, $12;"
        "and    $8, ~(0xf << 28);"
        "mtc0   $8, $12;");
#elif defined(_EVC)
    ASM(
        "mfc0   t0, $12;"
        "sll    t0, t0, 4;"
        "srl    t0, t0, 4;"
        "mtc0   t0, $12;");
#else
#error unknown compiler
#endif
}
